<!-- Modal -->
<div class="modal-dialog wide" style="width: 550px;">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">
            <#if hrLeave??>
                <#if hrLeave.id??>
                    编辑
                <#else>
                    新增
                </#if>
            </#if>
            </h4>
        </div>
        <div class="modal-body">
            <div id="errorMessage"><#include "../../message.ftl" /></div>
            <form class="form-horizontal" role="form" id="hrLeaveForm" method="post"
                  action="${absoluteContextPath}/hr/hrLeave/save">
            <#if hrLeave??>
                <#if hrLeave.id??>
                    <input type="hidden" name="id" value="${hrLeave.id?c}"/>
                <#else>
                    <input type="hidden" name="id" value=""/>
                </#if>
            </#if>
                <div class="row">
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">员工姓名</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                                <input name="employeeName" value="${hrLeave.employeeName!''}" type="text"
                                       class="form-control"
                                       readonly="true"/>
                                <input name="employeeId" id="employeeId2" value="${hrLeave.employeeId!''}"
                                       type="hidden" class="form-control">
                                <span class="input-group-addon" onclick="dorefreshCustome(this);"><i
                                        class="fa fa-search"></i></span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">离职原因</label>

                        <div class="col-sm-6">
                            <textarea name="leaveReason" class="form-control"
                                      style="width: 245px" rows="3">${hrLeave.leaveReason!''}</textarea>
                        <#--<input name="leaveReason" value="${hrLeave.leaveReason!''}" type="text" class="form-control"/>-->
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">离职日期</label>

                        <div class="col-sm-6">
                            <input name="leaveDate" value="${hrLeave.leaveDate!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">离职经济补偿金</label>

                        <div class="col-sm-6">
                            <input name="compensation" value="${hrLeave.compensation!''}" type="text"
                                   class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">是否可返聘</label>

                        <div class="col-sm-6">
                            <input name="restart" value="${hrLeave.restart!''}" type="text" class="form-control"/>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-sm-4 control-label">离职访谈记录总结</label>

                        <div class="col-sm-6">
                            <textarea name="leaveSummary" class="form-control"
                                      style="width: 248px" rows="3">${hrLeave.leaveSummary!''}</textarea>
                        <#--<input name="leaveSummary" value="${hrLeave.leaveSummary!''}" type="text" class="form-control"/>-->
                        </div>
                    </div>

                </div>
            </form>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
            <button type="button" class="btn btn-primary" onclick="save();">保存</button>
        </div>
    </div>
</div>
<script>
    function save() {
        $("#" + "hrLeaveForm").ajaxSubmit({
            success: function (data) {
                data = JSON.parse(data);
                if (data.returnCode == 1) {
                    $('#myModal').modal("hide");
                    $.showMessage({parentId: "showMessage", message: "信息保存成功！", type: "success"});
                    refreshTable();
                } else {
                    $.showMessage({parentId: "errorMessage", message: "<strong>错误信息</strong>：" + data.returnMsg, type: "error"});
                }
            }
        });
    }

    $(function () {

        $("input[name=leaveDate]").focus(function () {
            WdatePicker({dateFmt: 'yyyy-MM-dd'});
        })


        $("div[class='tooltip fade top in']").hide();
    });
</script>